package com.bestv.search.common.service;

import com.bestv.search.common.dataSource.DataSourceKey;
import com.bestv.search.common.model.InfoHeader;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface InfoHeaderManager {

    void saveOrUpdate(DataSourceKey key, InfoHeader header);

    void saveOrUpdate(DataSourceKey key, List<InfoHeader> headers);

    List<InfoHeader> get(DataSourceKey key, String name, String p_type);

    List<InfoHeader> get(DataSourceKey key, String code, Boolean byCode);

    InfoHeader get(DataSourceKey key, String code);

    InfoHeader get(DataSourceKey key, long id);

    int getInfoHeaderCountLikeName(DataSourceKey key, String name, String headerType);

    List<InfoHeader> getInfoHeaderLikeName(DataSourceKey key, String name, String headerType, int start, int limit);

    List<InfoHeader> getAllValidHeader(DataSourceKey key);

    boolean existOnlineInfosForHeaderId(DataSourceKey key, long headerId);

    List<InfoHeader> getHeadersByUpdateTime(DataSourceKey key, Date updateTime);

    String getDefaultCodeByHeaderId(DataSourceKey key, long headerId);

    int getTotalHitCountByHeaderId(DataSourceKey key, long headerId);

    int getItemCountByHeaderId(DataSourceKey key, long headerId);

    List<Map<String, String>> getInfoHeaderItemByHeaderId(DataSourceKey key, long headerId);

}